import { ref } from "vue";
import { defineStore } from "pinia";
import { getCateGoryApi } from "@/apis/layout";
import type { categoryResponce } from "@/types/layout";
export const useCateGoryStore = defineStore("category", () => {
  // state
  const cateGoryList = ref<categoryResponce[]>([]);
  //   action
  const getCateGory = async () => {
    const { data } = await getCateGoryApi();
    cateGoryList.value = data.result;
  };

  return {
    cateGoryList,
    getCateGory,
  };
});
